package cn.wolfcode.wolf2w.query;

import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
public class TravelCondition {
    //建立一个map结构，用于存储前台传递参数和后台要使用范围变量的映射关系
    //Map的key就是前台传递的参数
    //Map的value就是后台要使用的范围变量
    public static final Map<Integer, TravelCondition> DAY_MAP = new HashMap<>();
    public static final Map<Integer, TravelCondition> PEREXPEND_MAP = new HashMap<>();

    static{
        DAY_MAP.put(1, new TravelCondition(0, 3));
        DAY_MAP.put(2, new TravelCondition(4, 7));
        DAY_MAP.put(3, new TravelCondition(8, 14));
        DAY_MAP.put(4, new TravelCondition(15, Integer.MAX_VALUE));

        PEREXPEND_MAP.put(1, new TravelCondition(1, 999));
        PEREXPEND_MAP.put(2, new TravelCondition(1000, 5999));
        PEREXPEND_MAP.put(3, new TravelCondition(6000, 19999));
        PEREXPEND_MAP.put(4, new TravelCondition(20000, Integer.MAX_VALUE));
    }

    private int min;
    private int max;

    public TravelCondition(int min, int max){
        this.min = min;
        this.max = max;
    }
}
